Skip to content

Conversation

@pickypg
Copy link
Member

@pickypg pickypg commented Dec 20, 2019

This changes the optional username and password under cloud to actually be optional.

  cloud?: {
    id: string;
    // TODO: remove username and password here in 8
-    username: string;
-    password: string;
+    username?: string;
+    password?: string;
  }

This lets the documented workflow where the cloud.id is specified along with traditional auth work in TypeScript without cheating.

Prior to this PR, the workaround is:

  return new Client({
    cloud: {
      id: env.CLOUD_ID,
    } as ClientOptions['cloud'], // note: in 7.5.0 it has the optional user/pass as not optional
    auth: {
      username: env.USERNAME,
      password: env.PASSWORD,
    },
  });

This changes the optional username and password under `cloud` to actually be optional.

```diff
  cloud?: {
    id: string;
    // TODO: remove username and password here in 8
-    username: string;
-    password: string;
+    username?: string;
+    password?: string;
  }
```

This lets the documented workflow where the `cloud.id` is specified along with traditional `auth` work in TypeScript without cheating. The workaround to it is:

```ts
  return new Client({
    cloud: {
      id: env.CLOUD_ID,
    } as ClientOptions['cloud'], // note: in 7.5.0 it has the optional user/pass as not optional
    auth: {
      username: env.USERNAME,
      password: env.PASSWORD,
    },
  });
```
Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants